package org.zsqx.action;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Result;
import org.zsqx.bean.CountTimes;
import org.zsqx.dao.ZdzReportDAOImpl;
import org.zsqx.tools.PropertiesTools;

@Action(value="/propertiesSetAction",results={
		@Result(name="propertiesSetPage",location="/login/system/notesSetting.jsp"),
		@Result(name="countSetPage",location="/login/system/linkmanCountSetting.jsp")
})
public class PropertiesSetAction {
	private String notePassword;
	private String noteSendName;
	private String noteSendWarnName;
	private String noteDirectlySendWarnName;
	private CountTimes countTimes;
	private Double picWidth;
	public String noteSetPage(){
		PropertiesTools pt = new PropertiesTools();
		notePassword = pt.getPropertiesValue("notePassword");
		noteSendName = pt.getPropertiesValue("noteSendName");
		noteSendWarnName = pt.getPropertiesValue("noteSendWarnName");
		noteDirectlySendWarnName = pt.getPropertiesValue("noteDirectlySendWarnName");
		return "propertiesSetPage";
	}
	public String noteSet(){
		PropertiesTools pt = new PropertiesTools();
		pt.setPropertiesValue("notePassword", notePassword);
		pt.setPropertiesValue("noteSendName", noteSendName);
		pt.setPropertiesValue("noteSendWarnName", noteSendWarnName);
		pt.setPropertiesValue("noteDirectlySendWarnName",noteDirectlySendWarnName);
		return noteSetPage();
	}
	public String linkmanCountSetPage(){
		PropertiesTools pt = new PropertiesTools();
		countTimes = (CountTimes) pt.getPropertyesBean(new CountTimes());
		ZdzReportDAOImpl zd = new ZdzReportDAOImpl();
		picWidth = zd.getPicWidth();
		return "countSetPage";
	}
	public String linkmanCountSet(){
		PropertiesTools pt = new PropertiesTools();
		pt.setPropertiesBean(countTimes);
		ZdzReportDAOImpl zd = new ZdzReportDAOImpl();
		zd.uploadPicWidth(picWidth);
		return linkmanCountSetPage();
	}
	public String getNotePassword() {
		return notePassword;
	}
	public void setNotePassword(String notePassword) {
		this.notePassword = notePassword;
	}
	public String getNoteSendName() {
		return noteSendName;
	}
	public void setNoteSendName(String noteSendName) {
		this.noteSendName = noteSendName;
	}
	public CountTimes getCountTimes() {
		return countTimes;
	}
	public void setCountTimes(CountTimes countTimes) {
		this.countTimes = countTimes;
	}
	public Double getPicWidth() {
		return picWidth;
	}
	public void setPicWidth(Double picWidth) {
		this.picWidth = picWidth;
	}
	public String getNoteSendWarnName() {
		return noteSendWarnName;
	}
	public void setNoteSendWarnName(String noteSendWarnName) {
		this.noteSendWarnName = noteSendWarnName;
	}
	public String getNoteDirectlySendWarnName() {
		return noteDirectlySendWarnName;
	}
	public void setNoteDirectlySendWarnName(String noteDirectlySendWarnName) {
		this.noteDirectlySendWarnName = noteDirectlySendWarnName;
	}
	
}
